** check date valid
$date = date_parse(nStr);
if ($date["error_count"] == 0 && checkdate($date["month"], $date["day"], $date["year"]))
    echo "Valid date";
else
    echo "Invalid date";




onclick="document.location.href='{url op = "CN_TMTG" escape=false}'"


var table = document.getElementById( "myTable" );
		var header = Array();

		$("#myTable tr th").each(function(i, v){
				header[i] = $(this).text();
		})

		alert(header);

		$("#myTable tr td").each(function(i, v){
			data[i] = Array();
			$(this).find('input').each(function(ii, vv){
				data[$(this).attr('name')][] = $(this).val();
				alert($(this).attr('name'));
			}); 
		})

$(document).ready(function() {
	$('body').on('keydown', 'input, select, textarea', function(e) {
		alert("lllllllll");
		var self = $(this)
		  , form = self.parents('form:eq(0)')
		  , focusable
		  , next
		  ;
		if (e.keyCode == 13) {
			focusable = form.find('input,a,select,button,textarea').filter(':visible');
			next = focusable.eq(focusable.index(this)+1);
			if (next.length) {
				next.focus();
			} else {
				form.submit();
			}
			return false;
		}
	});
	 
});





function addnew() {

  // Insert a DOM element object
  $('#myDiv').load('http://localhost/duoctu3/templates/acctKT/SDTTForm_add.php');
  

  var newPara = document.createElement( 'p' );
  var newParaText = document.createTextNode( "Here's a DOM element" );
  newPara.appendChild( newParaText );
  $('#myDiv').before( newPara );

  // Insert a string of HTML
  $('#myDiv').before( "<p>kkkk</p>" );

  // Insert a jQuery object
  $('#myDiv').before( $("<p>Here's a jQuery object</p>") );

  // Insert the output from a callback function
  $('#myDiv').before( sayHello );

  function sayHello() {
    return "<p>Hello! This is the output from a callback function</p>";
  }

  //onclick='$("#myTable > tbody").append("{$newrow}");'


}


--------- keycode: L R U D 37 38 39 40

function myFunction()
{
alert(event.keyCode);
}
</script>
</head>
<body>

<p>A function is triggered when the user is pressing a key in the input field.</p>

<input type="text" onkeydown="myFunction()">

$("#lydo").keydown(function(){
		alert("lllllllll");
		var self = $(this)
		  , form = self.parents('form:eq(0)')
		  , focusable
		  , next
		  ;
		if (e.keyCode == 13) {
			focusable = form.find('input,a,select,button,textarea').filter(':visible');
			next = focusable.eq(focusable.index(this)+1);
			if (next.length) {
				next.focus();
			} else {
				form.submit();
			}
			return false;
		}
	});


--- Number
<div class="container">
    <label for="without-step">Without Step Attribute</label>
    <input type="number" pattern="[0-9]+([\,|\.][0-9]+)?" name="my-num"
    title="The number input must start with a number and use either comma or a dot as a decimal character." 
    id="without-step"/>
<div id="test1"></div>    
    <label for="with-step">With a step attribute set to 0.01</label>
<input type="number" pattern="[0-9]+([\,|\.][0-9]+)?" name="my-num"
    step="0.01"
    title="The number input must start with a number and use either comma or a dot as a decimal character." id="with-step"/>
    <div id="test2"></div>
</div>


---
Only numbers please: 
<input type="number" name="someid" onkeypress="return isNumberKey(event)" /> 

<script>
function isNumberKey(evt){
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;
    return true;
}    
</script>
